package com.carkeeper.service;

import com.carkeeper.dto.ServiceDTO;
import com.carkeeper.service.serviceFallback.ServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: dongxing
 * @date ：Created in 2020/6/1
 * @description ：
 * @version: 1.0
 */
@FeignClient(value = "carkeeper-shop",fallbackFactory = ServiceFallbackFactory.class)
public interface ServiceFeign {

    @GetMapping("/service/id/{id}")
    ServiceDTO getById(@PathVariable("id") Long id);
    /**
     * 根据id查询服务列表
     * @param ids
     * @return
     */
    @PostMapping("/service/list")
    List<ServiceDTO> getListById(@RequestBody List<Long> ids);
}
